﻿Imports MySql.Data

Public Class MySQLConnect
    Public Shared MaConnexion As New MySqlClient.MySqlConnection
    Public Shared MaCommandeSpecialRequete As New MySqlClient.MySqlCommand
    Public Shared MonRemplisseur As New MySqlClient.MySqlDataAdapter
    Public Shared MonJeuDeDonnees As New Data.DataSet
    Public Shared MaRequete As String
    Public Shared machaine As String

    Public Shared Sub SeConnecter(ByVal user As String, ByVal passwd As String)
        machaine = "Server=localhost;UserId=" & user & ";Password=" & passwd & ";Database=mydb"
        MaConnexion.ConnectionString = machaine
        MaConnexion.Open()
        MonJeuDeDonnees = New Data.DataSet("IAMP")
        MonJeuDeDonnees.Clear()
        MaCommandeSpecialRequete.CommandType = CommandType.Text
        MaCommandeSpecialRequete.Connection = MaConnexion
    End Sub

    Public Shared Sub SeConnecterDB(ByVal user As String, ByVal passwd As String, ByVal dbname As String)
        machaine = "Server=localhost;UserId=" & user & ";Password=" & passwd & ";Database=" & dbname
        MaConnexion.ConnectionString = machaine
        MaConnexion.Open()
        MonJeuDeDonnees = New Data.DataSet("IAMP")
        MonJeuDeDonnees.Clear()
        MaCommandeSpecialRequete.CommandType = CommandType.Text
        MaCommandeSpecialRequete.Connection = MaConnexion
    End Sub
End Class
